using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using QLKS.DataLayer.BusinessObjects;
using QLKS.DataLayer.Base;

namespace QLKS.DataLayer.ManagerObjects
{
    public partial interface ICTMatDoSuDungManager : IManagerBase<CTMatDoSuDung, int>
    {
		// Get Methods
		IList<CTMatDoSuDung> GetByMaPhong(System.String phong);
    }

    partial class CTMatDoSuDungManager : ManagerBase<CTMatDoSuDung, int>, ICTMatDoSuDungManager
    {
		#region Constructors
		
		public CTMatDoSuDungManager() : base()
        {
        }
        public CTMatDoSuDungManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<CTMatDoSuDung> GetByMaPhong(System.String phong)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(CTMatDoSuDung));
			
			
			ICriteria phongCriteria = criteria.CreateCriteria("Phong");
            phongCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", phong));
			
			return criteria.List<CTMatDoSuDung>();
        }
		
		#endregion
    }
}